<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>index</title>
    <script src="../js/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $("#loginButton").click(function(){
                //noinspection JSJQueryEfficiency
//                if ("" == $("#account").val() || $("#account").val() == undefined) {
//                    alert('账号不能为空！');
//                    return false;
//                }
//                //noinspection JSJQueryEfficiency
//                if("" == $("#password").val() || $("#password").val() == undefined){
//                    alert('密码不能为空');
//                    return false;
//                }
                $.ajax({
                    url: "/user/customer/list",
                    type:'post',
                    data:$('#loginForm').serialize(),
                    success:function(data){
                        alert(data.length);
                        var str = "<table>";
                        for(var i = 0; i < data.length; i++){
                            str += "<tr><td> " + i + "</td><td>" + data[i].account + "</td> <td> " + data[i].password + "</td> </tr> ";
                        }
                        str += "</table>";
                        $("#area").html(str);
                    }
                });
            });
        });
    </script>
</head>
<body>
    <form id="loginForm">
        <label>account: <input type="text" id="account" name="account"/></label> <br>
        <label>password: <input type="password" id="password" name="password"/></label> <br>
        <input type="button" value="提交" id="loginButton"/>
    </form>
    <br>
    <div id="area" name="area">aaa</div>
</body>
</html>